<template>
  <div ref="radar" class="radar">
    雷达图
  </div>
</template>

<script>
// import * as echarts from 'echarts'
import * as echarts from 'echarts/core'
import { RadarChart } from 'echarts/charts'
import { CanvasRenderer } from 'echarts/renderers'
echarts.use([RadarChart, CanvasRenderer])
export default {
  mounted() {
    var chartDom = this.$refs.radar
    var myChart = echarts.init(chartDom)
    var option = {
      radar: {
        // shape: 'circle',
        indicator: [
          { name: '考勤', max: 6500 },
          { name: '工作产出', max: 16000 },
          { name: '帮助同事', max: 30000 },
          { name: '培训新人', max: 38000 },
          { name: '修复bug', max: 52000 },
          { name: '新技术', max: 25000 }
        ]
      },
      series: [
        {
          name: 'Budget vs spending',
          type: 'radar',
          data: [
            {
              value: [4200, 3000, 20000, 35000, 50000, 1800],
              name: 'Allocated Budget'
            },
            {
              value: [5000, 14000, 2800, 26000, 42000, 21000],
              name: 'Actual Spending'
            }
          ]
        }
      ]
    }
    option && myChart.setOption(option)
  }
}
</script>
<style scoped>
.radar{
    height: 300px;
}
</style>
